//
//  HttpRequest.h
//  POS
//
//  Created by 廉英雷 on 15/9/24.
//  Copyright © 2015年 廉英雷. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "AFNetworking.h"

@protocol HttpRequestDelegate <NSObject>

@optional
-(void) finishedRequest:(id)receiveData withSender:(NSString *)sender;
-(void) errorRequest:(NSError*)error withSender:(NSString *)sender;
//0825 story 增加回调方法，从中可以获取错误报文
-(void)errorRequestDictionary:(NSDictionary *)errorDict withSender:(NSString *)sender;
-(void) sessionExpired;
-(void) serverFault;
@end
@interface HttpRequest : NSObject

@property (retain, nonatomic) id<HttpRequestDelegate>delegate;

@property(strong,nonatomic)AFHTTPSessionManager *sessManager;

@property(nonatomic,assign)BOOL requestCancel;

@property(assign,nonatomic) int tag;


- (void) getURL:(NSString *) url
 withDictionary:(NSDictionary *)dict
     httpHeader:(NSDictionary *)httpHeader
  receiveTarget:(id)target;  // 单个请求

- (void) putURL:(NSString *) url
 withDictionary:(NSDictionary *)dict
     httpHeader:(NSDictionary *)httpHeader
  receiveTarget:(id)target;

- (void) postURL:(NSString *) url
  withDictionary:(NSDictionary *)dict
      httpHeader:(NSDictionary *)httpHeader
   receiveTarget:(id)target;
//- (void) deleteURL:(NSString *) url
//    withDictionary:(NSDictionary *)dict
//        httpHeader:(NSDictionary *)httpHeader
//     receiveTarget:(id)target;
//

/**上传图片接口*/
//- (void) postURL:(NSString *) url
//        withData:(NSData *)data
//  withDictionary:(NSDictionary *)dict
//      httpHeader:(NSDictionary *)httpHeader
//   receiveTarget:(id)target;
//

@end
